Skip to content

fix: correct function name casing in IMP-002 conformance check - #18011

Merged
pelikhan merged 2 commits into
mainfrom
copilot/fix-function-name-casing
Feb 24, 2026
Merged

fix: correct function name casing in IMP-002 conformance check#18011
pelikhan merged 2 commits into
mainfrom
copilot/fix-function-name-casing

Conversation

Copilot AI commented Feb 24, 2026

Copy link
Copy Markdown
Contributor

The IMP-002 conformance check in scripts/check-safe-outputs-conformance.sh was grepping for computePermissionsForSafeOutputs (lowercase c), but the actual exported Go function is ComputePermissionsForSafeOutputs (uppercase C). This caused a permanent false HIGH failure.

Change

  • scripts/check-safe-outputs-conformance.sh: Fix grep pattern casing to match the exported function name
-        if grep -q "computePermissionsForSafeOutputs" "pkg/workflow/safe_outputs_permissions.go"; then
+        if grep -q "ComputePermissionsForSafeOutputs" "pkg/workflow/safe_outputs_permissions.go"; then
Original prompt

This section details on the original issue you should resolve

<issue_title>[Safe Outputs Conformance] IMP-002: Conformance check uses wrong function name casing (false HIGH failure)</issue_title>
<issue_description>### Conformance Check Failure

Check ID: IMP-002
Severity: HIGH (false positive — script bug)
Category: Implementation

Problem Description

The IMP-002 conformance check in scripts/check-safe-outputs-conformance.sh searches for computePermissionsForSafeOutputs (lowercase c) but the actual exported Go function is ComputePermissionsForSafeOutputs (uppercase C). Since grep is case-sensitive by default, this check always reports a HIGH failure even though the function is correctly implemented.

This is a false positive: the permission computation function exists, is exported (correct Go convention for public functions), and is fully implemented. The check simply uses the wrong casing.

Affected Components

  • Files: scripts/check-safe-outputs-conformance.sh (IMP-002 check, line ~350)
  • Implementation file: pkg/workflow/safe_outputs_permissions.go

Current Behavior

[HIGH] IMP-002: Permission computation function not found

The grep command:

grep -q "computePermissionsForSafeOutputs" "pkg/workflow/safe_outputs_permissions.go"

…fails because the actual function declaration is:

func ComputePermissionsForSafeOutputs(safeOutputs *SafeOutputsConfig) *Permissions {
```

### Expected Behavior

The IMP-002 check should detect the exported function `ComputePermissionsForSafeOutputs` and report:
```
[PASS] IMP-002: Permission computation function exists

Remediation Steps

This task can be assigned to a Copilot coding agent with the following steps:

  1. Open scripts/check-safe-outputs-conformance.sh and locate the IMP-002 check (around line 350).
  2. Change the grep pattern from computePermissionsForSafeOutputs to ComputePermissionsForSafeOutputs (capital C).
  3. Alternatively, use case-insensitive grep (grep -qi) so the check is resilient to future renames between exported/unexported variants.
Affected Code Location
# scripts/check-safe-outputs-conformance.sh ~line 350
check_permission_computation() {
    if [ -f "pkg/workflow/safe_outputs_permissions.go" ]; then
        # BUGGY: lowercase 'c' does not match exported Go function
        if grep -q "computePermissionsForSafeOutputs" "pkg/workflow/safe_outputs_permissions.go"; then
            log_pass "IMP-002: Permission computation function exists"
        else
            log_high "IMP-002: Permission computation function not found"
        fi
    else
        log_high "IMP-002: Permission computation file missing"
    fi
}

Fix:

if grep -q "ComputePermissionsForSafeOutputs" "pkg/workflow/safe_outputs_permissions.go"; then

Verification

After remediation, verify the fix by running:

bash scripts/check-safe-outputs-conformance.sh
```

The IMP-002 check should pass:
```
[PASS] IMP-002: Permission computation function exists

References

  • Safe Outputs Specification: docs/src/content/docs/reference/safe-outputs-specification.md
  • Conformance Checker: scripts/check-safe-outputs-conformance.sh
  • Permission computation implementation: pkg/workflow/safe_outputs_permissions.go
  • Run ID: §22316462213
  • Date: 2026-02-23

Generated by Daily Safe Outputs Conformance Checker

  • expires on Feb 24, 2026, 5:11 PM UTC

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…002)

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix casing in conformance check function name fix: correct function name casing in IMP-002 conformance check Feb 24, 2026
@pelikhan
pelikhan marked this pull request as ready for review February 24, 2026 00:43
Copilot AI review requested due to automatic review settings February 24, 2026 00:43
@pelikhan
pelikhan merged commit 081eb67 into main Feb 24, 2026
33 checks passed
@pelikhan
pelikhan deleted the copilot/fix-function-name-casing branch February 24, 2026 00:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fixes a false positive in the IMP-002 conformance check by correcting the function name casing from computePermissionsForSafeOutputs (lowercase) to ComputePermissionsForSafeOutputs (uppercase) to match the actual exported Go function name.

Changes:

  • Fixed grep pattern in IMP-002 check to use correct casing ComputePermissionsForSafeOutputs
  • Updated comment to reflect the correct function name

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test Results (Gemini)

  • GitHub MCP Testing: ✅
  • Web Fetch Testing: ✅
  • File Writing Testing: ✅
  • Bash Tool Testing: ✅
  • Build gh-aw: ❌ (Failed: Go toolchain download blocked)

Overall Status: FAIL

Smoke Gemini — Powered by Gemini

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Safe Outputs Conformance] IMP-002: Conformance check uses wrong function name casing (false HIGH failure)

3 participants